import request from '@/utils/request'

// 登录函数
/**
 * @description: 登录接口
 * @param {*} data.mobile 手机号
 * @param {*} data.password 密码
 * @return {*} promise
 */
export function login(data) {
  return request({
    url: '/sys/login',
    method: 'POST',
    data
  })
}

/**
 * 新增部门
 */
export const addDepartment = (data) => {
  return request.post('http://localhost:3000/department', data)
}

/**
 * 获取部门详情
 */
export const getDepartmentDetail = (id) => {
  return request.get(`http://localhost:3000/department/${id}`)
}
/**
 * 修改部门
 */
export const updateDepartment = (data) => {
  return request.put(`http://localhost:3000/department/${data.id}`, data)
}
/**
 * 删除部门
 */
export const delDepartment = (id) => {
  return request.delete(`http://localhost:3000/department/${id}`)
}
